<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Data.List</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  stable</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Operations on lists.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.List</span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Basic functions</span></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>     </span><span class="annot"><a href="GHC.Base.html#%2B%2B"><span class="hs-operator">(++)</span></a></span><span>
</span><span id="line-23"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#head"><span class="hs-identifier">head</span></a></span><span>
</span><span id="line-24"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#last"><span class="hs-identifier">last</span></a></span><span>
</span><span id="line-25"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#tail"><span class="hs-identifier">tail</span></a></span><span>
</span><span id="line-26"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#init"><span class="hs-identifier">init</span></a></span><span>
</span><span id="line-27"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#uncons"><span class="hs-identifier">uncons</span></a></span><span>
</span><span id="line-28"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#singleton"><span class="hs-identifier">singleton</span></a></span><span>
</span><span id="line-29"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#null"><span class="hs-identifier">null</span></a></span><span>
</span><span id="line-30"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#length"><span class="hs-identifier">length</span></a></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>   </span><span class="annot"><span class="hs-comment">-- * List transformations</span></span><span>
</span><span id="line-33"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-identifier">map</span></a></span><span>
</span><span id="line-34"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#reverse"><span class="hs-identifier">reverse</span></a></span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#intersperse"><span class="hs-identifier">intersperse</span></a></span><span>
</span><span id="line-37"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#intercalate"><span class="hs-identifier">intercalate</span></a></span><span>
</span><span id="line-38"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#transpose"><span class="hs-identifier">transpose</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#subsequences"><span class="hs-identifier">subsequences</span></a></span><span>
</span><span id="line-41"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#permutations"><span class="hs-identifier">permutations</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Reducing lists (folds)</span></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldl"><span class="hs-identifier">foldl</span></a></span><span>
</span><span id="line-46"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldl%27"><span class="hs-identifier">foldl'</span></a></span><span>
</span><span id="line-47"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldl1"><span class="hs-identifier">foldl1</span></a></span><span>
</span><span id="line-48"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#foldl1%27"><span class="hs-identifier">foldl1'</span></a></span><span>
</span><span id="line-49"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldr"><span class="hs-identifier">foldr</span></a></span><span>
</span><span id="line-50"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#foldr1"><span class="hs-identifier">foldr1</span></a></span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Special folds</span></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#concat"><span class="hs-identifier">concat</span></a></span><span>
</span><span id="line-55"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#concatMap"><span class="hs-identifier">concatMap</span></a></span><span>
</span><span id="line-56"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#and"><span class="hs-identifier">and</span></a></span><span>
</span><span id="line-57"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#or"><span class="hs-identifier">or</span></a></span><span>
</span><span id="line-58"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#any"><span class="hs-identifier">any</span></a></span><span>
</span><span id="line-59"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#all"><span class="hs-identifier">all</span></a></span><span>
</span><span id="line-60"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#sum"><span class="hs-identifier">sum</span></a></span><span>
</span><span id="line-61"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#product"><span class="hs-identifier">product</span></a></span><span>
</span><span id="line-62"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#maximum"><span class="hs-identifier">maximum</span></a></span><span>
</span><span id="line-63"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#minimum"><span class="hs-identifier">minimum</span></a></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Building lists</span></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Scans</span></span><span>
</span><span id="line-68"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanl"><span class="hs-identifier">scanl</span></a></span><span>
</span><span id="line-69"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanl%27"><span class="hs-identifier">scanl'</span></a></span><span>
</span><span id="line-70"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanl1"><span class="hs-identifier">scanl1</span></a></span><span>
</span><span id="line-71"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanr"><span class="hs-identifier">scanr</span></a></span><span>
</span><span id="line-72"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#scanr1"><span class="hs-identifier">scanr1</span></a></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Accumulating maps</span></span><span>
</span><span id="line-75"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Traversable.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span>
</span><span id="line-76"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Traversable.html#mapAccumR"><span class="hs-identifier">mapAccumR</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Infinite lists</span></span><span>
</span><span id="line-79"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#iterate"><span class="hs-identifier">iterate</span></a></span><span>
</span><span id="line-80"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#iterate%27"><span class="hs-identifier">iterate'</span></a></span><span>
</span><span id="line-81"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#repeat"><span class="hs-identifier">repeat</span></a></span><span>
</span><span id="line-82"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#replicate"><span class="hs-identifier">replicate</span></a></span><span>
</span><span id="line-83"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#cycle"><span class="hs-identifier">cycle</span></a></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Unfolding</span></span><span>
</span><span id="line-86"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unfoldr"><span class="hs-identifier">unfoldr</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Sublists</span></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Extracting sublists</span></span><span>
</span><span id="line-91"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#take"><span class="hs-identifier">take</span></a></span><span>
</span><span id="line-92"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#drop"><span class="hs-identifier">drop</span></a></span><span>
</span><span id="line-93"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#takeWhile"><span class="hs-identifier">takeWhile</span></a></span><span>
</span><span id="line-96"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#dropWhile"><span class="hs-identifier">dropWhile</span></a></span><span>
</span><span id="line-97"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#dropWhileEnd"><span class="hs-identifier">dropWhileEnd</span></a></span><span>
</span><span id="line-98"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#span"><span class="hs-identifier">span</span></a></span><span>
</span><span id="line-99"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#break"><span class="hs-identifier">break</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#stripPrefix"><span class="hs-identifier">stripPrefix</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#group"><span class="hs-identifier">group</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#inits"><span class="hs-identifier">inits</span></a></span><span>
</span><span id="line-106"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#tails"><span class="hs-identifier">tails</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Predicates</span></span><span>
</span><span id="line-109"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span>
</span><span id="line-110"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#isSuffixOf"><span class="hs-identifier">isSuffixOf</span></a></span><span>
</span><span id="line-111"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#isInfixOf"><span class="hs-identifier">isInfixOf</span></a></span><span>
</span><span id="line-112"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier">isSubsequenceOf</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Searching lists</span></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Searching by equality</span></span><span>
</span><span id="line-117"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#elem"><span class="hs-identifier">elem</span></a></span><span>
</span><span id="line-118"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#notElem"><span class="hs-identifier">notElem</span></a></span><span>
</span><span id="line-119"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#lookup"><span class="hs-identifier">lookup</span></a></span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Searching with a predicate</span></span><span>
</span><span id="line-122"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#find"><span class="hs-identifier">find</span></a></span><span>
</span><span id="line-123"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#filter"><span class="hs-identifier">filter</span></a></span><span>
</span><span id="line-124"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Indexing lists</span></span><span>
</span><span id="line-127"></span><span>   </span><span class="hs-comment">-- | These functions treat a list @xs@ as a indexed collection,</span><span>
</span><span id="line-128"></span><span>   </span><span class="hs-comment">-- with indices ranging from 0 to @'length' xs - 1@.</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#%21%21"><span class="hs-operator">(!!)</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#elemIndex"><span class="hs-identifier">elemIndex</span></a></span><span>
</span><span id="line-133"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#elemIndices"><span class="hs-identifier">elemIndices</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#findIndex"><span class="hs-identifier">findIndex</span></a></span><span>
</span><span id="line-136"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#findIndices"><span class="hs-identifier">findIndices</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Zipping and unzipping lists</span></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#zip"><span class="hs-identifier">zip</span></a></span><span>
</span><span id="line-141"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#zip3"><span class="hs-identifier">zip3</span></a></span><span>
</span><span id="line-142"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zip4"><span class="hs-identifier">zip4</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zip5"><span class="hs-identifier">zip5</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zip6"><span class="hs-identifier">zip6</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zip7"><span class="hs-identifier">zip7</span></a></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#zipWith"><span class="hs-identifier">zipWith</span></a></span><span>
</span><span id="line-145"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#zipWith3"><span class="hs-identifier">zipWith3</span></a></span><span>
</span><span id="line-146"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zipWith4"><span class="hs-identifier">zipWith4</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zipWith5"><span class="hs-identifier">zipWith5</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zipWith6"><span class="hs-identifier">zipWith6</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#zipWith7"><span class="hs-identifier">zipWith7</span></a></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#unzip"><span class="hs-identifier">unzip</span></a></span><span>
</span><span id="line-149"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#unzip3"><span class="hs-identifier">unzip3</span></a></span><span>
</span><span id="line-150"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unzip4"><span class="hs-identifier">unzip4</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unzip5"><span class="hs-identifier">unzip5</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unzip6"><span class="hs-identifier">unzip6</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unzip7"><span class="hs-identifier">unzip7</span></a></span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Special lists</span></span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Functions on strings</span></span><span>
</span><span id="line-155"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#lines"><span class="hs-identifier">lines</span></a></span><span>
</span><span id="line-156"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#words"><span class="hs-identifier">words</span></a></span><span>
</span><span id="line-157"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unlines"><span class="hs-identifier">unlines</span></a></span><span>
</span><span id="line-158"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unwords"><span class="hs-identifier">unwords</span></a></span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** \&quot;Set\&quot; operations</span></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#nub"><span class="hs-identifier">nub</span></a></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#delete"><span class="hs-identifier">delete</span></a></span><span>
</span><span id="line-165"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#%5C%5C"><span class="hs-operator">(\\)</span></a></span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#union"><span class="hs-identifier">union</span></a></span><span>
</span><span id="line-168"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#intersect"><span class="hs-identifier">intersect</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** Ordered lists</span></span><span>
</span><span id="line-171"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#sort"><span class="hs-identifier">sort</span></a></span><span>
</span><span id="line-172"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#sortOn"><span class="hs-identifier">sortOn</span></a></span><span>
</span><span id="line-173"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#insert"><span class="hs-identifier">insert</span></a></span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Generalized functions</span></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** The \&quot;@By@\&quot; operations</span></span><span>
</span><span id="line-178"></span><span>   </span><span class="hs-comment">-- | By convention, overloaded functions have a non-overloaded</span><span>
</span><span id="line-179"></span><span>   </span><span class="hs-comment">-- counterpart whose name is suffixed with \`@By@\'.</span><span>
</span><span id="line-180"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-181"></span><span>   </span><span class="hs-comment">-- It is often convenient to use these functions together with</span><span>
</span><span id="line-182"></span><span>   </span><span class="hs-comment">-- 'Data.Function.on', for instance @'sortBy' ('Prelude.compare'</span><span>
</span><span id="line-183"></span><span>   </span><span class="hs-comment">-- ``Data.Function.on`` 'Prelude.fst')@.</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span>   </span><span class="annot"><span class="hs-comment">-- *** User-supplied equality (replacing an @Eq@ context)</span></span><span>
</span><span id="line-186"></span><span>   </span><span class="annot"><span class="hs-comment">-- | The predicate is assumed to define an equivalence.</span></span><span>
</span><span id="line-187"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#nubBy"><span class="hs-identifier">nubBy</span></a></span><span>
</span><span id="line-188"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#deleteBy"><span class="hs-identifier">deleteBy</span></a></span><span>
</span><span id="line-189"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#deleteFirstsBy"><span class="hs-identifier">deleteFirstsBy</span></a></span><span>
</span><span id="line-190"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#unionBy"><span class="hs-identifier">unionBy</span></a></span><span>
</span><span id="line-191"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#intersectBy"><span class="hs-identifier">intersectBy</span></a></span><span>
</span><span id="line-192"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#groupBy"><span class="hs-identifier">groupBy</span></a></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span>   </span><span class="annot"><span class="hs-comment">-- *** User-supplied comparison (replacing an @Ord@ context)</span></span><span>
</span><span id="line-195"></span><span>   </span><span class="annot"><span class="hs-comment">-- | The function is assumed to define a total ordering.</span></span><span>
</span><span id="line-196"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#sortBy"><span class="hs-identifier">sortBy</span></a></span><span>
</span><span id="line-197"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#insertBy"><span class="hs-identifier">insertBy</span></a></span><span>
</span><span id="line-198"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#maximumBy"><span class="hs-identifier">maximumBy</span></a></span><span>
</span><span id="line-199"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Foldable.html#minimumBy"><span class="hs-identifier">minimumBy</span></a></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span>   </span><span class="annot"><span class="hs-comment">-- ** The \&quot;@generic@\&quot; operations</span></span><span>
</span><span id="line-202"></span><span>   </span><span class="hs-comment">-- | The prefix \`@generic@\' indicates an overloaded function that</span><span>
</span><span id="line-203"></span><span>   </span><span class="hs-comment">-- is a generalized version of a &quot;Prelude&quot; function.</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#genericLength"><span class="hs-identifier">genericLength</span></a></span><span>
</span><span id="line-206"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#genericTake"><span class="hs-identifier">genericTake</span></a></span><span>
</span><span id="line-207"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#genericDrop"><span class="hs-identifier">genericDrop</span></a></span><span>
</span><span id="line-208"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#genericSplitAt"><span class="hs-identifier">genericSplitAt</span></a></span><span>
</span><span id="line-209"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#genericIndex"><span class="hs-identifier">genericIndex</span></a></span><span>
</span><span id="line-210"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#genericReplicate"><span class="hs-identifier">genericReplicate</span></a></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Foldable.html"><span class="hs-identifier">Data.Foldable</span></a></span><span>
</span><span id="line-215"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Traversable.html"><span class="hs-identifier">Data.Traversable</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.OldList.html"><span class="hs-identifier">Data.OldList</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.List.html#all"><span class="hs-identifier">all</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#and"><span class="hs-identifier">and</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#any"><span class="hs-identifier">any</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#concat"><span class="hs-identifier">concat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#concatMap"><span class="hs-identifier">concatMap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#elem"><span class="hs-identifier">elem</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#find"><span class="hs-identifier">find</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-218"></span><span>                             </span><span class="annot"><a href="GHC.List.html#foldl"><span class="hs-identifier">foldl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#foldl1"><span class="hs-identifier">foldl1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#foldl%27"><span class="hs-identifier">foldl'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-identifier">foldr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#foldr1"><span class="hs-identifier">foldr1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-219"></span><span>                             </span><span class="annot"><a href="Data.OldList.html#mapAccumR"><span class="hs-identifier">mapAccumR</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#maximum"><span class="hs-identifier">maximum</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#maximumBy"><span class="hs-identifier">maximumBy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#minimum"><span class="hs-identifier">minimum</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.OldList.html#minimumBy"><span class="hs-identifier">minimumBy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-220"></span><span>                             </span><span class="annot"><a href="GHC.List.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#notElem"><span class="hs-identifier">notElem</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#null"><span class="hs-identifier">null</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#or"><span class="hs-identifier">or</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#product"><span class="hs-identifier">product</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#sum"><span class="hs-identifier">sum</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier">Bool</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier">Eq</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator">(==)</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#otherwise"><span class="hs-identifier">otherwise</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span class="hs-comment">-- | The 'isSubsequenceOf' function takes two lists and returns 'True' if all</span><span>
</span><span id="line-225"></span><span class="hs-comment">-- the elements of the first list occur, in order, in the second. The</span><span>
</span><span id="line-226"></span><span class="hs-comment">-- elements do not have to occur consecutively.</span><span>
</span><span id="line-227"></span><span class="hs-comment">--</span><span>
</span><span id="line-228"></span><span class="hs-comment">-- @'isSubsequenceOf' x y@ is equivalent to @'elem' x ('subsequences' y)@.</span><span>
</span><span id="line-229"></span><span class="hs-comment">--</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-231"></span><span class="hs-comment">--</span><span>
</span><span id="line-232"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-233"></span><span class="hs-comment">--</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- &gt;&gt;&gt; isSubsequenceOf &quot;GHC&quot; &quot;The Glorious Haskell Compiler&quot;</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- True</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- &gt;&gt;&gt; isSubsequenceOf ['a','d'..'z'] ['a'..'z']</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- True</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- &gt;&gt;&gt; isSubsequenceOf [1..10] [10,9..0]</span><span>
</span><span id="line-239"></span><span class="hs-comment">-- False</span><span>
</span><span id="line-240"></span><span id="local-6989586621679510467"><span class="annot"><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier hs-type">isSubsequenceOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679510467"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679510467"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679510467"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span></span><span>
</span><span id="line-241"></span><span id="isSubsequenceOf"><span class="annot"><span class="annottext">isSubsequenceOf :: forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier hs-var hs-var">isSubsequenceOf</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-242"></span><span class="annot"><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier hs-var">isSubsequenceOf</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-243"></span><span class="annot"><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier hs-var">isSubsequenceOf</span></a></span><span> </span><span id="local-6989586621679510324"><span class="annot"><span class="annottext">a :: [a]
</span><a href="#local-6989586621679510324"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679510323"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679510323"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679510322"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679510322"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679510321"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679510321"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679510320"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679510320"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679510323"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679510321"><span class="hs-identifier hs-var">y</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier hs-var">isSubsequenceOf</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679510322"><span class="hs-identifier hs-var">a'</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679510320"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-244"></span><span>                               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="Data.List.html#isSubsequenceOf"><span class="hs-identifier hs-var">isSubsequenceOf</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679510324"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679510320"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-245"></span></pre></body></html>